/* const{http}=require("../../utils/http")
Page({
    data: {
        music:""
    },
    onLoad: function (options) {
        var url=`http://47.108.197.28:3000/mv/first`
        var music=[];
        http({
            url,
            success:res=>{
                // console.log(res.data.data)
                var res=res.data.data;
                res.forEach(item=>{
                    var {id,cover,name,}=item;
                    music.push({
                        id,
                        cover,
                        name
                    })
                })
                this.setData({
                    music
                })
            }
        })
    },
    onTap(event){
        // console.log(event)
        var {aid}=event.currentTarget.dataset;
        wx.navigateTo({
            url: `/pages/detail/detail?id=${aid}`
        })
    }
}) */
const { getMvHttp} = require("../../utils/p-http")
Page({


    data: {
        music:""
    },

    onLoad: function (options) {
        var {
            id
        } = options;
        
        getMvHttp(id).then(res => {
            console.log(res);

            this.handleMvData(res)
        })


    },
    handleMvData(res) {
        var music=[];
        var res=res.data.data;
        res.forEach(item=>{
            var {id,cover,name,}=item;
            music.push({
                id,
                cover,
                name
            })
        })
        this.setData({
            music
        })
    },
    onTap(event){
        // console.log(event)
        var {aid}=event.currentTarget.dataset;
        wx.navigateTo({
            url: `/pages/detail/detail?id=${aid}`
        })
    }



})